<%@ tag pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%@ attribute name="id" required="true"%>
<%@ attribute name="name" required="false"%>
<%@ attribute name="caption" required="true"%>
<%@ attribute name="maxLength" required="false"%>
<%@ attribute name="model" required="false"%>

<div class="form-group">
    <label for="${id}" class="col-sm-4 control-label">${caption}</label>
    <div class="col-sm-8">
        <input id="${id}" class="form-control" name="${empty name? id : name}" type="text"  data-bv-notempty
        <c:if test="${!empty model}">
           v-model="${model}"
        </c:if>
        <c:choose>
        <c:when test="${!empty maxLength}">
               data-bv-stringlength data-bv-stringlength-min="1" data-bv-stringlength-max="${maxLength}"
        </c:when>
        <c:otherwise>
               data-bv-stringlength data-bv-stringlength-min="1" data-bv-stringlength-max="32"
        </c:otherwise>
        </c:choose>
        />
    </div>
</div>